import java.util.Arrays;

public class Test {
    public static int max(int a, int b){
        return a > b?a : b;

    }
    public static double max(double a,double b, double c){
        if(a > b){
            if(a>c){
                return a;
            }
        }
        else if(a < b){
            if (b<c){
                return c;
            }
        }
        return c;
    }
    public static void main(String[] args) {
        int ret = max(4,5);
        double scd = max(1.5,2.8,9.03);
        System.out.println(ret);
        System.out.println(scd);
    }
    public static int max2(int a ,int b){
        return a > b?a: b;
    }
    public static int max3(int a,int b,int c){
        int max = max2(a,b);
        int ret = max2(max ,c);
        return ret;


    }
    public static void main7(String[] args) {
//使用函数求最大值
        int ret = max3(4,6,8);
        System.out.println(ret);

    }


    public static void bubbleSort(int[] arr){
        //冒泡排序
        //确定趟数
        boolean flg = false;
        for (int i = 0; i < arr.length - 1; i++) {
            //确定次数
            for (int j = 0; j < arr.length - 1 -i; j++) {
                //排成升序
                if (arr[j] > arr[j + 1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                    flg = true;
                }
            }
            if (flg == false) {
                return;
            }
        }
    }

    public static void main6(String[] args) {
        int[] arr = {1,2,11,45,48,998,77,1000,1234};
        bubbleSort(arr);
        System.out.println(Arrays.toString(arr));

    }
    public static int findsum(int[]arr , int key){
        int right = arr.length-1;
        int lift = 0;

        while (lift <= right){
            int tmp = (right + lift) / 2;
            if (key > arr[tmp]) {
                lift = tmp + 1;
            }//去左侧区间查找
            else if (key < arr[tmp]) {
                right = tmp - 1;

            }//找到了
            else {
                return tmp;
            }
        }
        return -1;
    }

    public static void main5(String[] args) {
        int[] arr = {1,2,5,9,11,16,100};
        findsum(arr , 16);
        int ret = findsum(arr , 16);
        System.out.println(ret);

    }

    public static String myToString(int[] arr){
        String ret = "[";
        for (int i = 0; i < arr.length; i++) {
            ret += arr[i];
            if (arr[i] == arr[arr.length - 1]){
                break;
            }
            ret += ",";

        }
        ret += "]";
        return ret;
    }
    public static void main4(String[] args) {
        int arr[] = {1,2,3,4,5};
        System.out.println(myToString(arr));








    }
    public static int[] funac(int[] arr){
        int ret[] = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            ret[i] = arr[i] * 2;

        }
        return ret;
    }



    public static void main3(String[] args) {
        int[] arr = {1,2,3,4,5};
        int[] tmp = funac(arr);
        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(tmp));


    }

    public static void main2(String[] args) {
        int[] aray = {1, 2, 3, 4};

    }
    public static void main1(String[] args){
        int a = 90;
        System.out.println(a);
    }
}